package com.enjoyread.api.controller;

import com.enjoyread.common.bo.SmsBo;
import com.enjoyread.common.vo.R;
import com.enjoyread.core.manager.intf.AliSmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/sms/")
@CrossOrigin//实现跨域

@Api(value = "实现验证码操作的接口",tags = "实现验证码操作的接口")
public class AliSmsController {
    @Autowired
    private AliSmsService service;
    @ApiOperation(value = "实现发送注册验证码的接口",notes = "实现发送注册验证码的接口")
    @GetMapping("sendrcod")
    public R sendR(String phone){
        return service.sendRCode(phone);
    }
    @ApiOperation(value = "实现校验注册验证码的接口",notes = "实现校验注册验证码的接口")
    @PostMapping("checkrcode")
    public R checkR(@RequestBody SmsBo bo){
        return service.checkRCode(bo);
    }
    @ApiOperation(value = "实现发送登录验证码的接口",notes = "实现发送登录验证码的接口")
    @GetMapping("sendlcode")
    public R sendL(String phone){
        return service.sendLCode(phone);
    }
    @ApiOperation(value = "实现发送找回密码验证码的接口",notes = "实现发送找回密码验证码的接口")
    @GetMapping("/sendfcode")
    public R sendF(String phone){
        return service.sendFCode(phone);
    }
}
